package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingCollegeMapper;
import com.ruoyi.teaching.domain.TeachingCollege;
import com.ruoyi.teaching.service.ITeachingCollegeService;

/**
 * 学院信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-21
 */
@Service
public class TeachingCollegeServiceImpl implements ITeachingCollegeService 
{
    @Autowired
    private TeachingCollegeMapper teachingCollegeMapper;

    /**
     * 查询学院信息
     * 
     * @param collegeId 学院信息主键
     * @return 学院信息
     */
    @Override
    public TeachingCollege selectTeachingCollegeByCollegeId(Long collegeId)
    {
        return teachingCollegeMapper.selectTeachingCollegeByCollegeId(collegeId);
    }

    /**
     * 查询学院信息列表
     * 
     * @param teachingCollege 学院信息
     * @return 学院信息
     */
    @Override
    public List<TeachingCollege> selectTeachingCollegeList(TeachingCollege teachingCollege)
    {
        return teachingCollegeMapper.selectTeachingCollegeList(teachingCollege);
    }

    /**
     * 新增学院信息
     * 
     * @param teachingCollege 学院信息
     * @return 结果
     */
    @Override
    public int insertTeachingCollege(TeachingCollege teachingCollege)
    {
        teachingCollege.setCreateTime(DateUtils.getNowDate());
        return teachingCollegeMapper.insertTeachingCollege(teachingCollege);
    }

    /**
     * 修改学院信息
     * 
     * @param teachingCollege 学院信息
     * @return 结果
     */
    @Override
    public int updateTeachingCollege(TeachingCollege teachingCollege)
    {
        teachingCollege.setUpdateTime(DateUtils.getNowDate());
        return teachingCollegeMapper.updateTeachingCollege(teachingCollege);
    }

    /**
     * 批量删除学院信息
     * 
     * @param collegeIds 需要删除的学院信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingCollegeByCollegeIds(Long[] collegeIds)
    {
        return teachingCollegeMapper.deleteTeachingCollegeByCollegeIds(collegeIds);
    }

    /**
     * 删除学院信息信息
     * 
     * @param collegeId 学院信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingCollegeByCollegeId(Long collegeId)
    {
        return teachingCollegeMapper.deleteTeachingCollegeByCollegeId(collegeId);
    }
}
